Cleanup make-text-button call
authorjustbur <justin@burkett.cc>
Tue, 1 Dec 2015 01:58:48 +0000 (20:58 -0500)
committerjustbur <justin@burkett.cc>
Tue, 1 Dec 2015 01:58:48 +0000 (20:58 -0500)
which-key.el

index 04bc4ef9a4663da6e24dc879a3fbac93930f3c6f..57f475368cd26b09791f708e4be385d2d82e202e 100644 (file)
@@ -1218,26 +1218,24 @@ ORIGINAL-DESCRIPTION is the description given by
                    (substring desc 6) desc))
          (desc (if group (concat "+" desc) desc))
          (desc (which-key--truncate-description desc)))
-    (eval
-     `(make-text-button
-       ,desc nil
-       'face ',(cond (hl-face hl-face)
-                     (group 'which-key-group-description-face)
-                     (local 'which-key-local-map-description-face)
-                     (t 'which-key-command-description-face))
-       'help-echo ,(cond
-                    ((and (fboundp (intern original-description))
-                          (documentation (intern original-description))
-                          tooltip-mode)
-                     (documentation (intern original-description)))
-                    ((and (fboundp (intern original-description))
-                          (documentation (intern original-description))
-                          (let* ((doc (documentation (intern original-description)))
-                                 (str (replace-regexp-in-string "\n" " " doc))
-                                 (max (floor (* (frame-width) 0.8))))
-                            (if (> (length str) max)
-                                (concat (substring str 0 max) "...")
-                              str)))))))
+    (make-text-button desc nil
+      'face (cond (hl-face hl-face)
+                  (group 'which-key-group-description-face)
+                  (local 'which-key-local-map-description-face)
+                  (t 'which-key-command-description-face))
+      'help-echo (cond
+                  ((and (fboundp (intern original-description))
+                        (documentation (intern original-description))
+                        tooltip-mode)
+                   (documentation (intern original-description)))
+                  ((and (fboundp (intern original-description))
+                        (documentation (intern original-description))
+                        (let* ((doc (documentation (intern original-description)))
+                               (str (replace-regexp-in-string "\n" " " doc))
+                               (max (floor (* (frame-width) 0.8))))
+                          (if (> (length str) max)
+                              (concat (substring str 0 max) "...")
+                            str))))))
     desc))
 
 (defun which-key--format-and-replace (unformatted)